<!DOCTYPE html>
<html lang="en">
<head>
    <!--<meta charset="UTF-8">-->
    <title>jqueryval</title>
</head>
    <script src="/jquery-3.2.1.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("button").click(function () {
            str = $("#id1").val();
            console.log(str);
            alert(str);
        });
    });
</script>
<body>
<input type="text" value="HelloWorld" id="id1"/>
<button type="button" >弹出文笨内容</button>
</body>
</html>